import service from "../utils/request.js"

// 修改用户信息
export const putProfile = (data) => {
    return service({
        url: '/system/user/profile',
        method: 'put',
        data
    })
}

// 账号密码登录
export const accLogin = (data) => {
    return service({
        url: '/auth/login',
        method: 'post',
        data
    })
}

// 获取短信验证码
export const getSmsCode = (data) => {
    return service({
        url: '/system/public/sendCode',
        method: 'post',
        data
    })
}

// 短信登录
export const smsLogin = (data) => {
    return service({
        url: '/auth/smsLogin',
        method: 'post',
        data
    })
}

// 获取用户信息
export const userProfile = (params) => {
    return service({
        url: '/system/user/profile',
        method: 'get',
        params
    })
}

// 完善用户信息-新建保存
export const updateInfo = (data) => {
    return service({
        url: '/msb/saleSkill/updateInfo',
        method: 'post',
        data
    })
}

// 获取用户信息
export const getSalesBaseInfo = (data) => {
    return service({
        url: '/msb/saleSkill/getSalesBaseInfo',
        method: 'post',
        data
    })
}

// 卖家获得的评论-分页
export const getCommentList = (data) => {
    return service({
        url: '/system/salesComment/salesCommentPage',
        method: 'post',
        data
    })
}

// 获取订单列表
export const getOrderList = (data) => {
    return service({
        url: '/system/salesOrder/salesOrderPage',
        method: 'post',
        data
    })
}

// 获取二维码链接
export function getQRCodeUrl(data) {
    return service({
        url: '/system/userAuth/getAuthUrl',
        method: 'post',
        data
    })
}

// 查询二维码验证结果
export function checkQRCodeStatus(data) {
    return service({
        url: '/system/userAuth/getAuthResult',
        method: 'post',
        data
    })
}

// 卖家信息查询
export const getSalesInfo = (data) => {
    return service({
        url: '/msb/saleSkill/getSalesBaseInfo',
        method: 'post',
        data
    })
}

// 获取在售商品列表
export const getGoodsByStatus = (data) => {
    return service({
        url: '/msb/goods/getGoodsByStatus',
        method: 'post',
        data
    })
}

// 卖家更改服务时间
/**
 * goodsId: 商品id
 * serverTimeType: 开启服务时间,0:暂停销售 1:48小时内 2:7天内
 * @param {goodsId, serverTimeType} data
 * @returns 
 */
export const updateServiceTime = (data) => {
    return service({
        url: '/msb/goods/changeServerTime',
        method: 'post',
        data
    })
}

// 卖家删除商品
/**
 * goodsId: 商品id
 * @param {goodsId} data
 * @returns 
 */
export const deleteGoods = (data) => {
    return service({
        url: '/msb/goods/deleteGoods',
        method: 'post',
        data
    })
}

// 获取收入信息
export const salesFinacePage = (data) => {
    return service({
        url: '/system//salesFinance/salesFinacePage',
        method: 'post',
        data
    })
}

// 卖家评论买家
export const salesComment = (data) => {
    return service({
        url: '/system/buyerComment/saleComment',
        method: 'post',
        data
    })
}

// 卖家得到买家信息(聊天)
export const saleGetChatInfo = (data) => {
    return service({
        url: '/system/saleInfo/saleGetChatInfo',
        method: 'post',
        data
    })
}
// 找回密码
export const resetPwd = (data) => {
    return service({
        url: '/system/public/resetPwdBySms',
        method: 'post',
        data
    })
}

// 查询绑定的银行卡信息
export const getBankInfo = (data) => {
    return service({
        url: '/system/salesFinance/queryBank',
        method: 'post',
        data
    })
}
// 绑定银行卡
export const bindBankCard = (data) => {
    return service({
        url: '/system/salesFinance/bandBank',
        method: 'post',
        data
    })
}
